<extend file='resource/view/wechat'>
    <block name="content">
        <!-- TAB NAVIGATION -->
        <ul class="nav nav-tabs" role="tablist">
            <br>
            <li class="active"><a href="{{url('wx.index')}}">微信基本消息管理</a></li>
            <li><a href="{{url('wx.post')}}">添加基本回复</a></li>
        </ul>
        <table class="table table-hover">
            <thead>
            <tr>
                <th width="10%">编号</th>
                <th width="10%">关键词</th>
                <th>回复内容</th>
                <th width=>创建时间</th>
            </tr>
            </thead>
            <tbody>
            <foreach from="$show" value="$d">
                <tr>
                    <td>{{$d['id']}}</td>
                    <td>{{$d->keywords->keywords}}</td>
                    <td style=" display: inline-block;width:100%;word-break: keep-all;overflow: hidden;text-overflow: ellipsis;">{{$d['content']}}</td>
                    <td>{{$d->keywords->created_at}}</td>
                    <td>
                        <div class="btn-group btn-group-sm">
                            <a href="{{url('wx.post','',['id'=>$d['id']])}}" class="btn btn-success">编辑</a>
                            <a href="javascript:;" onclick="del({{$d['id']}},{{$d['id']}})"
                               class="btn btn-danger">删除</a>
                            <!-- onclick="del(1{{$d['id']}},2{{$d['id']}})-->
                            <!--对应下面del(1module_id,2id)-->
                        </div>
                    </td>
                </tr>
            </foreach>
            </tbody>
        </table>
        <div>
            {{$show->links()}}
        </div>
        <script>
            function del(id) {
                util.confirm('确定删除吗?', function (res) {
                    location.href = "{{url('wx.del')}}&id=" + id;
                })
            }
        </script>
    </block>
